﻿using MT.Common;
using MT.Models.Entity;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace MT.DAL.Abstract.UserCenter
{
    public interface IUserService
    {
        Task<List<UserRole>> GetUserRoleByUserIdOrInstitutionIdsAsync(int userId, List<int> institutionIds);
        Task<List<UserRole>> GetUserRoleByUserIdAsync(int userId, int? institutionId);
        Task<UserRole> GetUserUnityRoleByUserIdAsync(int userId, string authRoleTypeDic);
        Task< User> GetUser(int userID);
        Task<User> GetCacheUser(int userId);
        Task<User> GetByDingDingUnionidName(string dingDingUnionid);
        Task<List<User>> GetUserByPhoneListAsync(List<string> phones);

        Task<List<User>> GetAppUserByPhoneListAsync(List<string> phones);
       
            Task<List<User>> GetCacheUserByPhoneListAsync(List<string> phones);
        Task<User> GetCacheUserByDingdingUserIdAsync(string dingdingUserId);
        Task<User> GetUserByDingdingUserIdAsync(string dingdingUserId);
        Task< User> GetByUseName(string phoneNumber);
        Task<User> GetByName(string name);
        Task< User> GetByPhoneNumber(string userName);

        Task<int> CreateAsync( User model);

        Task<List< User>> GetCacheByIdsAsync(List<int> ids);

        Task<List<User>> GetByIdsAsync(List<int> ids);
        Task<List<User>> GetUserByBusinessRoleAsync(int storeId, List<string> businessRoleDics);
       

        Task< User> UpdateAsync( User model);
        Task<List<User>> UpdateRestAsync(List<User> list);
        Task<List<User>> UpdateAsync(List<User> list);
        Task<List<User>> UpdateAppAsync(List<User> list);
        Task<List<User>> UpdateAsync(List<User> list, List<string> fieldName);
        Task< User> UpdateByAsync( User model, List<int> ids, string[] modifiedProNames);

        Task<PageModel< User>> GetPageAsync(int pageIndex, int pageSize, string name, int? institutionId);

        Task<PageModel< User>> GetPageAsync(int pageIndex, int pageSize, string name, int? storeId = null, string businessRoleDic = null);
        Task<List<UserBusinessRole>> GetUserBusinessRoleByUserIdAsync(int userId);

        Task<int> GetCountByInstitutionIdAsync(int institutionId);
    }
}
